type AnimationType =
  | "auto"
  | "none"
  | "slide-in-right"
  | "slide-in-left"
  | "slide-in-top"
  | "slide-in-bottom"
  | "fade-in"
  | "zoom-out"
  | "zoom-fade-out"
  | "pop-in";

export const onNavigateTo = (
  url: string,
  animationType: AnimationType = "slide-in-right"
) => uni.navigateTo({ url, animationType });

// 数量转换
export const onConvertCount = (count: number, label?: string): string => {
  if (count === 0 && label) return label;
  if (count > 99999) {
    const value = (count / 10000).toString();
    const index = value.indexOf(".") + 2;
    return `${value.slice(0, index)}万`;
  } else {
    return count.toString();
  }
};
